package com.umgsai.thread.thread01;

public class UserThread extends Thread {

	private User user;
	public UserThread(User user){
		super();
		this.user = user;
	}
	
	@Override
	public void run() {
		user.printString("b", "bbb");
	}
	
	public static void main(String[] args) {
		try {
			User user = new User();
			UserThread thread = new UserThread(user);
			thread.start();
			Thread.sleep(1000);
			thread.stop();//stop()方法强行释放锁
			System.out.println(user.getUsername() + "-" + user.getPassword());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
